package com.ynrcc.util;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class ReadFile {
	public static String readFile(String path) {
		String line = null;
		String result = "";
		try {
			FileInputStream fs = new FileInputStream(path);
			InputStreamReader reader = new InputStreamReader(fs, "GBK");
			BufferedReader br = new BufferedReader(reader);

			while ((line = br.readLine()) != null) {
				result = result + line;
			}

			br.close();
			reader.close();
			fs.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return result;
	}

}
